# -*- coding: utf-8 -*-#

# -------------------------------------------------------------------------------
# Name:         txt_utils
# Description:  文本文件的操作
# Author:       zhuchunxu
# Date:         2020/11/6
# -------------------------------------------------------------------------------
import json


class TextUtils:
    @staticmethod
    def insert_json(job, file_name):
        dic = dict(job)
        s = json.dumps(dic, ensure_ascii=False)
        with open(file_name, "a+",encoding='utf-8') as f:
            f.write(s + "\n")
            print("完成页面：{} 的内容采集！".format(job["job_url"]))
